package com.imarkket.Library;

import org.apache.http.protocol.HTTP;

/**
 * Created by Sistemas on 23/05/2014.
 */
public class c_constantes {

    public enum TipoIP {
        DES, PRU, PRE, PRO
    }

    private String API_CODIFICACION = HTTP.UTF_8;
    private int INT_ID_APP = 1;
    private String API_PROTOCOL_HTTP = "http://";
    // private String API_PROTOCOL_HTTPS = "https://";

    // private String API_IP_DES = "192.168.1.36:8000"; // ip portatil casa
    // private String API_IP_DES = "192.168.0.198:8000"; // ip portatil casa foz
    private String API_IP_DES = "192.168.1.69:6900";                            // ip portatil belkin
    // private String API_IP_DES = "localhost:8000";

    // private String API_IP_DES = "imarkket.net"; // ip portatil casa foz
    private String API_IP_PRE = "192.168.1.69:6900";                            // ip trabajo
    // ip trabajo

    // private String API_IP_PRO = "83.37.86.174:8000"; // raspi publica
    private String API_IP_PRO = "interactua.no-ip.info:6900";                            // raspi privada
    // PRO interactua.dnsapi.info

    // http://192.168.1.69:6900/imarkket/classes/select.class.php
    private String API_URL_BASE = "/imarkket/";
    // private String API_URL_BASE = "/classes/";
    private String API_FILE = "q.php";

    // Selecciono el modo de trabajo
    private TipoIP ModoIP = TipoIP.PRO;

    private String iv = "fB&YR),lNZ2fmTX3";
    private String secretkey = "o{mpmFKAg+o[r3b-";

    public int getID_APP() {
        return this.INT_ID_APP;
    }

    public c_constantes() {
    }

    public String getIV() {
        return this.iv;
    }

    public String getsecretkey() {
        return this.secretkey;
    }

    public TipoIP getModoIP() {
        return this.ModoIP;
    }

    public String getAPI_CODIFICACION() {
        return this.API_CODIFICACION;
    }

    public String getAPI_PROTOCOL_HTTP() {
        return this.API_PROTOCOL_HTTP;
    }

    public String getAPI_IP(TipoIP pAPI_IP) {
        switch (pAPI_IP) {
            case DES:
                c_logging.getInstance().log(c_logging.LOG_INFO, "IP: " + this.getAPI_PROTOCOL_HTTP() + this.API_IP_DES + this.getAPI_URL_BASE() + this.getAPI_FILE());
                return this.API_IP_DES;
            case PRE:
                c_logging.getInstance().log(c_logging.LOG_INFO, "IP: " + this.getAPI_PROTOCOL_HTTP() + this.API_IP_PRE + this.getAPI_URL_BASE() + this.getAPI_FILE());
                return this.API_IP_PRE;
            case PRO:
                c_logging.getInstance().log(c_logging.LOG_INFO, "IP: " + this.getAPI_PROTOCOL_HTTP() + this.API_IP_PRO + this.getAPI_URL_BASE() + this.getAPI_FILE());
                return this.API_IP_PRO;
            default:
                c_logging.getInstance().log(c_logging.LOG_INFO, "IP: DEFAULT");
                return this.API_IP_DES;
        }
    }

    public String getAPI_URL_BASE() {
        return this.API_URL_BASE;
    }

    public String getAPI_FILE() {
        return this.API_FILE;
    }
}